﻿using Common.Log;
using DryWCS.Service.GlobalVariable;
using RestSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace DryWCS.Biz.Http
{
    public class HttpClient
    {
        public static bool ResportToWMS(string commandID)
        {
            try
            {
                var client = new RestClient(GV.WMSURL);
                var requestGet = new RestRequest(GV.WMSResource + commandID, Method.GET);
                var response = client.Execute(requestGet);

                if (response.StatusCode == HttpStatusCode.OK)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog("发送WMS消息异常", ex);
                return false;
            }
        }
    }
}
